﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#if !WINDOWS_PHONE && !SILVERLIGHT
using Microsoft.Xna.Framework.GamerServices;
#endif

namespace Brain
{
#if !WINDOWS_PHONE && !SILVERLIGHT && !MONOGAME
    public class XboxAvatar_CustomAnimation : XboxAvatar
    {
        public CustomAvatarAnimationPlayer AnimationPlayer { get; protected set; }

        internal string AnimPlace;
        public XboxAvatar_CustomAnimation(string animPlace)
            : base()
        {
            this.AnimPlace = animPlace;
            Load();
        }
        public XboxAvatar_CustomAnimation(AvatarDescription desc, string animPlace)
            : base(desc)
        {
            this.AnimPlace = animPlace;
            Load();
        }
        public XboxAvatar_CustomAnimation(Gamer gamer, SetXboxAvatar set, string animPlace)
            : base(gamer, set)
        {
            this.AnimPlace = animPlace;
            Load();
        }

        private void Load()
        {
            AnimationPlayer = new CustomAvatarAnimationPlayer(
                Engine.Instance.ContentManager.Load<CustomAvatarAnimationData>(AnimPlace));
            this.IAvatarAnimation = AnimationPlayer;
            Loaded = true;
        }

        public override void Update()
        {
            AnimationPlayer.Update(Engine.Instance.GameTime.ElapsedGameTime, Loop);
        }
    }
#endif
}
